//
//  HallVC.m
//  K8彩票
//
//  Created by zhoubo on 2017/6/6.
//  Copyright © 2017年 zhoubo. All rights reserved.
//

#import "HallVC.h"
#import "HallLottery.h"

#import "KuaiVC.h"
#import "PaiLie5VC.h"
#import "PaiLieVC.h"

#import "ShuangSeVC.h"
#import "DaLeTouVC.h"

@interface HallVC ()

@end

@implementation HallVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationController.navigationBar.hidden = YES;
    
    HallLottery* lotterys = [[HallLottery alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height)];
    
    
    //添加当前类对象为一个观察者，name和object设置为nil，表示接收一切通知
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notice:) name:@"hallfast3" object:nil];

    
    [self.view addSubview:lotterys];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    ((ViewController *)[UIApplication sharedApplication].keyWindow.rootViewController).mainTabbar.frame = CGRectMake(0, ScreenHeight() - 49, ScreenWidth(), 49);
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

-(void)notice:(NSNotification*)sender
{
    if ([sender.userInfo[@"vc"] containsString: @"fast3"]) {
        
        KuaiVC* vc = [KuaiVC new];
        [self presentViewController:vc animated:YES completion:nil];
        if ([sender.userInfo[@"vc"] containsString:@"jiangsu"]) {
            //75
            vc.kind = 75;
        }
        else if ([sender.userInfo[@"vc"] containsString:@"hubei"])
        {
            //80
            vc.kind = 80;
            
        }
        else if ([sender.userInfo[@"vc"] containsString:@"anhui"])
        {
            //76
            vc.kind = 76;
        }

        
    }
    else if ([sender.userInfo[@"vc"] isEqualToString: @"pailie3"])
    {
        [self.navigationController pushViewController:[PaiLieVC new] animated:YES];
    }
    else if([sender.userInfo[@"vc"] isEqualToString: @"pailie5"])
    {
        [self.navigationController pushViewController:[PaiLie5VC new] animated:YES];
    }
    else if ([sender.userInfo[@"vc"] isEqualToString: @"shuangse"])
    {
        [self.navigationController pushViewController:[ShuangSeVC new] animated:YES];
    }
    else if ([sender.userInfo[@"vc"] isEqualToString: @"daletou"])
    {
        [self.navigationController pushViewController:[DaLeTouVC new] animated:YES];
    }
    
}

@end
